import request from '@/utils/request.js'

export function login(data){
    return request({
        url: 'sysUser/login',
        method: 'post',
        data
    })
}

export function getUserInfo(data){
    return request({
        url: 'sysMenu/user/menu',
        method: 'post',
        data
    })
}

export function modifyPwd(data){
    return request({
        url: 'sysUser/update/password',
        method: 'post',
        data
    })
}

export function addUser(data){
    return request({
        url: 'sysUser/register',
        method: 'post',
        data
    })
}

export function getUserList(data){
    return request({
        url: 'sysUser/list',
        method: 'post',
        data
    })
}

export function getOneUserInfo(data){
    return request({
        url: 'sysUser/detail',
        method: 'post',
        data
    })
}

export function editUserInfo(data){
    return request({
        url: 'sysUser/update/user',
        method: 'post',
        data
    })
}

export function resetUserPwd(data){
    return request({
        url: 'sysUser/sys/pwd',
        method: 'post',
        data
    })
}

export function changeState(data){
    return request({
        url: 'sysUser/update/login/state',
        method: 'post',
        data
    })
}

export function addRole(data){
    return request({
        url: 'sysRole/insert',
        method: 'post',
        data
    })
}

export function getMenuList(data){
    return request({
        url: 'sysMenu/check/menu',
        method: 'post',
        data
    })
}

export function getRoleList(data){
    return request({
        url: 'sysRole/user/role',
        method: 'post',
        data
    })
}

export function getRoleListPage(data){
    return request({
        url: 'sysRole/list',
        method: 'post',
        data: data
    })
}

export function editRoleInfo(data){
    return request({
        url: 'sysRole/update/role',
        method: 'post',
        data
    })
}
export function changeRoleState(data){
    return request({
        url: 'sysRole/update/state',
        method: 'post',
        data
    })
}